package com.crm.jdy.service.usermanager;

import com.crm.jdy.common.pojo.PermissionCatalogue;
import com.crm.jdy.common.mapper.PermissionCatalogueMapper;
import org.apache.dubbo.config.annotation.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**   
 * @Description:(权限对应的目录服务实现)
 *
 * @version: V1.0
 * @author: kong
 * 
 */
@Service(version = "${service.version}")
@Component
public class PermissionCatalogueServiceImpl  extends ServiceImpl<PermissionCatalogueMapper,PermissionCatalogue> implements PermissionCatalogueService  {

    @Autowired
    PermissionCatalogueMapper permissionCatalogueDao;

    @Override
    public List<PermissionCatalogue> seletePermissionCatalogue(PermissionCatalogue callAplanInfoDto) {
        List<PermissionCatalogue> bookList = permissionCatalogueDao.seletePermissionCatalogue(callAplanInfoDto);
        return bookList;
    }

    @Override
    public boolean updatePermissionCatalogue(PermissionCatalogue roleInfo) {
        return  permissionCatalogueDao.updateById(roleInfo) > 0;
    }

    @Override
    public boolean addPermissionCatalogue(PermissionCatalogue roleInfo) {
        return  permissionCatalogueDao.insert(roleInfo) > 0;
    }

    @Override
    public boolean removePermissionCatalogue(String peCa) {
        return  permissionCatalogueDao.deleteById(peCa) > 0;

    }

    @Override
    public boolean addUpatePermissionCatalogue(List<PermissionCatalogue> catalogueList) {
        return this.saveOrUpdateBatch(catalogueList);
    }

}